package cn.wowjoy.pda.android_pharmacy.app;

import android.content.Context;
import android.os.Process;

import com.facebook.drawee.backends.pipeline.Fresco;
import com.orhanobut.logger.LogLevel;
import com.orhanobut.logger.Logger;

import cn.wowjoy.pda.android_pharmacy.common.utils.ImagePipelineConfigFactory;
import cn.wowjoy.pda.android_pharmacy.common.utils.PreferenceManager;


public class MyApplication extends BaseApplication {

    public static MyApplication instance;
    public static Context mContext;

    @Override
    public void onCreate() {
        super.onCreate();

        instance = this;
        mContext=getApplicationContext();
        //greenDao全局配置,只希望有一个数据库操作对象
//        GreenDaoManager.getInstance();
        PreferenceManager.init(instance);
        new Thread() {
            @Override
            public void run() {
                super.run();
                Process.setThreadPriority(Process.THREAD_PRIORITY_BACKGROUND);
                Fresco.initialize(instance, ImagePipelineConfigFactory.getOkHttpImagePipelineConfig(instance));
//                cookieJar = new PersistentCookieJar(new SetCookieCache(), new SharedPrefsCookiePersistor(getApplicationContext()));
                Logger.init().logLevel(LogLevel.NONE);
            }
        }.start();
    }
}
